<template>
  <div class="avatar" :class="{'avatar-sm': sm}"  @click="handle">
     <img v-lazy="url" alt="">
  </div>
</template>
<script>
export default {
  name: 'Avatar',
  props: {
    url: String,
    sm: Boolean,
    to: String
  },
  methods:{
    handle(){
      if (this.to) {
        this.$router.push(this.to);
      }
    }
  }
}
</script>

